<?php
namespace app\member\controller;
use think\Controller;
use app\member\model\Member as MemberModel;
use think\Db;
class Index extends Common
{
    public function index()
    {
        $userid=session('id'); 
       $member=db('member')->where(array('id'=>$userid))->find();
       //print_r($member);
        $this->assign("member",$member);	
        return view();
    }


    public function update(){
    	if(request()->isPost()){
            
        	$member=new MemberModel();
        	$data=array("username"=>input('realname'),"mobile"=>input('mobile'),"qq"=>input('qq'),"weixin"=>input('weixin'),"fax"=>input('fax'),"remark"=>input('remark'));
        	$member->update($data,array('id'=>input('id')));
        	$this->success('个人信息更新成功！',url('member/index/index'));
        }
    }

  
}
